<template>
  <a v-if="to.startsWith('http')" :href="to" target="_blank" rel="noopener noreferrer">
    <slot></slot>
  </a>
  <router-link v-else :to="to">
    <slot></slot>
  </router-link>
</template>
<script setup>
defineProps({
  to: {
    type: String,
    required: true
  }
})
</script>